package com.cx.dubbo;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @Author:chenxiaoyi
 * @Date:2021/1/20 16:21
 */
public class SocketServer {

    /*socket服务端*/
    public static void main(String[] args) throws IOException {

        ServerSocket serverSocket = new ServerSocket(9999);
        Socket socket = serverSocket.accept();
        System.out.println("客户端连接----");
        BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        String str;
        while ((str =  reader.readLine()) != null){
            System.out.println("客户端消息:"+str);
        }

    }

}
